package com.patterns.strategy;

/**
 * 策略上下文，用于客户端选择算法
 * 负责与具体策略类交互
 * 具体算法处理与客户端解耦，使得算法可以独立于客户端独立变化
 * @author huangke
 *
 */
public class PriceStrategyContext {
	private PriceStrategy strategy;//当前采用的算法

	public PriceStrategyContext(PriceStrategy strategy) {
		this.strategy = strategy;
	}
	
	public double getStrategy(double price){
		return strategy.getPrice(price);
	}
	
}
